<!--操作反馈内容-->
<template>
	<view class="feedback-msg">
		<view class="feedback-icon" 
			:style="`background-color:`+comTypeState.bgColor">
			<u-icon :name="comTypeState.iconName" color="#fff" size="84rpx"></u-icon>
		</view>
		<view class="title">
			{{title}}
		</view>
		<view class="text">
			{{text}}
		</view>
	</view>
</template>

<script>
	export default {
		name: 'OperationalFeedback',
		props: {
			type: {
				type: String,
				default(){
					return 'success'
				}
			},
			title: {
				type: String,
				default(){
					return '反馈成功'
				}
			},
			text: {
				type: String,
				default(){
					return '感谢您对我们的关注与支持，我们会认真处理您的反馈，尽快修复和完善相关功能'
				}
			}
		},
		data(){
			return {
				typeObj: {
					'success': {
						bgColor: '#2979FF',
						iconName: 'checkmark'
					},
					'error': {
						bgColor: '#fa3534',
						iconName: 'close'
					},
					'warning': {
						bgColor: '#ff9900',
						iconName: 'error'
					}
				}
			}
		},
		computed: {
			comTypeState(){
				//通过props传回来的type做相应的图标，颜色显示
				return this.typeObj[this.type];
			}
		}
	}
</script>

<style scoped lang="scss">
	.feedback-msg{
		display: flex;
		flex-direction: column;
		align-items: center;
		.feedback-icon{
			display: flex;
			justify-content: center;
			align-items: center;
			width: 180rpx;
			height: 180rpx;
			border-radius: 50%;
			margin-top: 240rpx;
			margin-bottom: 20rpx;
		}
		.title{
			text-align: center;
			line-height: 120rpx;
			color: #000;
			font-size: 36rpx;
			font-weight: 500;
		}
		.text{
			padding: 0 60rpx;
			text-align: center;
			color: #606266;
			font-size: 26rpx;
			line-height: 48rpx;
		}
	}
</style>
